<?php namespace Waimai\Controller;
class Controller extends \Hdphp\Controller\Controller {
	public function __construct() {
		if(!Q('session.id'))
		{
			go('Admin/Login/login'); 
		}

		$set = Db::table("set")->where('username',$_SESSION['username'])->first();
		Weixin::appID($set['appid'])->appsecret($set['appsecret'])->getAccessToken();
		//执行父类的构造函数
		parent::__construct();
	}

}
